<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/3/18
 * Time: 19:00
 */

namespace Admin\Model;

use Think\Model;

/**
 * Class BrandModel
 * @package Admin\Model
 * 品牌管理
 */
class BrandModel extends Model
{
    protected $pk='bid';
    protected $tableName='brand';
   /**
    * 品牌添加和修改
    */
    public function store($data){
//        dd($data);die;
        $action=isset($data['bid'])?'save':'add';
        $res=$this->$action($data);
        if($res){
            return ['valid'=>1,'msg'=>'操作成功'];
        }else{
            return ['valid'=>0,'msg'=>'操作失败'];
        }
    }
    /**
     * 查找出所有的品牌
     */
    public function alldata(){
        return $this->select();
    }
}